package com.mogu.comment.annotion;

import com.mogu.comment.Messages;
import com.mogu.comment.constraint.IdValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Description:不在能知，而在能行
 *
 * 不为空字符串
 * @author: 梁西华
 * @date: 2020/6/11/10:55
 **/
@Target({ElementType.TYPE,ElementType.FIELD,ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {IdValidator.class})
public @interface IdValid {
    boolean required() default true;
    //String ID_LENGTH_THIRTY_TWO = "length must be 32";
    String message() default Messages.ID_LENGTH_THIRTY_TWO;

    String value() default "";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

}
